///////////////////////////////////////////////
///      Product Name: WordQuicker          ///
/// Copyright (c)2007, Marstone Studio      ///
///           Author: marstone              ///
///        Web Site: marstone.net           ///
///      Mail/MSN: marstone@163.com         ///
///         Created: 2007.10.02             ///
///      Last Modified: 2007.10.02          ///
///////////////////////////////////////////////
using System;
using System.Collections.Generic;
using System.Text;
using Word = Microsoft.Office.Interop.Word;

namespace Studio.Windows.WordQuicker
{
    /// <summary>
    /// Document interface, support the most basic operations
    /// </summary>
    public interface WQDocument
    {
        /// <summary>
        /// Fill blank after specified Bookmark
        /// </summary>
        void FillByBookmark(string Bookmark, string TextToFill);

        /// <summary>
        /// Insert Text after specified Bookmark
        /// </summary>
        void InsertAfterBookmark(string Bookmark, string TextToInsert);

        /// <summary>
        /// Copy BookmarkSource selected Range after BookmarkDest
        /// </summary>
        void CopyAfterBookmark(string BookmarkDest, string BookmarkSource);

        /// <summary>
        /// Find a table by index
        /// </summary>
        WQTable LocateTable(int Index);

        /// <summary>
        /// Return the count of tables in this word document
        /// </summary>
        int TableCount { get; }

        /// <summary>
        /// Replace given pattern by substitute
        /// </summary>
        bool ReplaceOne(string Pattern, string Substitute);

        /// <summary>
        /// Replace all
        /// </summary>
        bool ReplaceAll(string Pattern, string Substitute);

        /// <summary>
        /// Copy all
        /// </summary>
        void CopyAll();

        /// <summary>
        /// Paste @ End
        /// </summary>
        void PasteEnd();

        /// <summary>
        /// Undo for N times
        /// </summary>
        bool Undo(int N);

        /// <summary>
        /// SaveAs, overwrite without prompt
        /// </summary>
        bool SaveDocumentAs(string NewFileName);

        /// <summary>
        /// Save wihout prompt
        /// </summary>
        bool SaveDocument();

        /// <summary>
        /// Close this document. Save if IsSave == true
        /// </summary>
        void CloseDocument(bool IsSave);

    }
}
